package com.siro.auth.controller;

import com.siro.auth.base.common.domain.PageRequest;
import com.siro.auth.base.common.domain.Result;
import com.siro.auth.service.IInspPlanRlnToolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试请求类
 *
 * @author starsea
 * @date 2022-12-14 19:34
 */
@RestController
@RequestMapping("/biz/inspPlanRlnTool")
public class InspPlanRlnToolController {

    @Autowired
    private IInspPlanRlnToolService inspPlanRlnToolService;

    /**
     * 调用外系统返回数据 组装成分页数据回显给前端
     * @param pageRequest
     * @return
     */
    @PostMapping("/getRuleAndModel")
    public Result getRuleAndModel(@RequestBody PageRequest pageRequest) {
        inspPlanRlnToolService.getRuleAndModel(pageRequest);
        return Result.ok();
    }

    /**
     * 测试异步创建任务
     * @return
     */
    public Result createIsueTask() {
        inspPlanRlnToolService.asynsBatchCreateIsueTasks();
        return Result.ok();
    }
}
